home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 1.iso / ARGONET / PD / PROGRAMMING / DESKLIBC / SOURCES.ZIP / DeskLib / !DLSources / Libraries / Menu / c / MakeIndrct < prev    next >
Text File  |  1995-07-09  |  2KB  |  52 lines

  1. /*
  2.     ####             #    #     # #
  3.     #   #            #    #       #          The FreeWare C library for
  4.     #   #  ##   ###  #  # #     # ###             RISC OS machines
  5.     #   # #  # #     # #  #     # #  #   ___________________________________
  6.     #   # ####  ###  ##   #     # #  #
  7.     #   # #        # # #  #     # #  #    Please refer to the accompanying
  8.     ####   ### ####  #  # ##### # ###    documentation for conditions of use
  9.     ________________________________________________________________________
  10.  
  11.     File:    Menu.MakeIndrct.c
  12.     Author:  Copyright © 1994 Lenny
  13.     Version: 0.01 (20 Nov 1994)
  14.     Purpose: Makes the specified menu item an 'indirected text' icon.
  15.     History: 0.01 (20 Nov 94) : Added 'Menu_MakeIndirected()'
  16.  
  17. */
  18.  
  19. /* --- LOAD HEADERS ------------------------------------------------------ */
  20.  
  21. /* --- DeskLib ----------------------------------------------------------- */
  22. #include "DeskLib:Wimp.h"
  23. #include "DeskLib:Menu.h"
  24.  
  25. /* === FUNCTION DEFINITIONS ============================================== */
  26.  
  27. extern void Menu_MakeIndirected(menu_ptr menu, int entry, char *buffer, int size)
  28. /*
  29.  *  Makes the specified menu item 'indirected text', pointing to 'buffer'.
  30.  *  ie the menu item will contain the text held in 'buffer'.
  31.  *
  32.  *  Similar to 'Menu_MakeWritable()' except this doesn't produce a writable
  33.  *  entry.  It does provide a user defined buffer though, and updating
  34.  *  this is simpler (and quicker) than calling 'Menu_SetText()'.
  35.  *  The validation string is set to null, as this is only really of use
  36.  *  with a writable icon, when the user may need to restrict the characters
  37.  *  entered.
  38.  */
  39. {
  40.   menu_item *item = (menu_item *) (((int) menu) + sizeof(menu_block));
  41.  
  42.   item = &item[entry];
  43.   item->iconflags.data.indirected = TRUE;
  44.  
  45.   item->icondata.indirecttext.buffer      = buffer;
  46.   item->icondata.indirecttext.bufflen     = size;
  47.   item->icondata.indirecttext.validstring = (char *) -1;
  48.  
  49. }
  50.  
  51. /***************************************************************************/
  52.